import os, sys
from PyQt5.QtWidgets import QApplication, QWidget, QMessageBox
from PyQt5 import uic

class AudioMk(QWidget):
    def __init__(self):
        super().__init__()
        self.ui = None
        self.ui = uic.loadUi(os.path.join(os.path.dirname(os.path.abspath(__file__)), '../ui/audio_mk.ui'))
        self.init_ui()

    def init_ui(self):
        self.ui.pushButton.clicked.connect(self.on_button_clicked)

    def on_button_clicked(self):
        print("on_button_clicked")
        self.showMessageBox()

    def showMessageBox(self):
        # 创建并显示提示框
        msg_box = QMessageBox()
        msg_box.setIcon(QMessageBox.Information)
        msg_box.setText("这是一个提示框")
        msg_box.setWindowTitle("提示")
        msg_box.setStandardButtons(QMessageBox.Ok)

        msg_box.exec_()


if __name__ == '__main__':
    app = QApplication(sys.argv)
    window = AudioMk()
    window.ui.show()
    app.exec()
